/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newspaper;

import entity.Category;
import entity.SubCategory;
import java.util.ArrayList;
import model.CategoryModel;
import model.SubCategoryModel;

/**
 *
 * @author xuanhung2401
 */
public class VnexpressCategory {

    public static void main(String[] args) {
        CategoryModel cateModel = new CategoryModel();
        SubCategoryModel subModel = new SubCategoryModel();
        
        //Xa hoi category.
        Category cate = new Category();
        cate.setAlias("xa-hoi"); 
        cate.setTitle("Xã hội");        
        ArrayList<String> listSub = new ArrayList<String>();
        SubCategory sub1 = new SubCategory();
        sub1.setAlias("giao-duc");
        sub1.setTitle("Giáo dục");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("nhip-dieu-tre");
        sub1.setTitle("Nhịp điệu trẻ");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("du-lich");
        sub1.setTitle("Du lịch");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("du-hoc");
        sub1.setTitle("Du học");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        cate.setSubCategory(listSub); 
        cateModel.save(cate);
        
        //The gioi
        cate = new Category();
        cate.setAlias("the-gioi"); 
        cate.setTitle("Thế giới");        
        listSub = new ArrayList<String>();
        sub1 = new SubCategory();
        sub1.setAlias("cuoc-song-do-day");
        sub1.setTitle("Cuộc sống đó đây");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("anh");
        sub1.setTitle("Ảnh");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("nguoi-viet-5-chau");
        sub1.setTitle("Người Việt 5 châu");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("phan-tich");
        sub1.setTitle("Phân tích");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("tu-lieu");
        sub1.setTitle("Tư liệu");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        
        cate.setSubCategory(listSub); 
        cateModel.save(cate);
        
        //Van hoa
        cate = new Category();
        cate.setAlias("van-hoa"); 
        cate.setTitle("Văn hoá");        
        listSub = new ArrayList<String>();
        sub1 = new SubCategory();
        sub1.setAlias("hoa-hau");
        sub1.setTitle("Hoa hậu");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("guong-mat-nghe-sy");
        sub1.setTitle("Nghệ sỹ");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("am-nhac");
        sub1.setTitle("Âm nhạc");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("thoi-trang");
        sub1.setTitle("Thời trang");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("san-khau-dien-anh");
        sub1.setTitle("Điện ảnh");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        sub1 = new SubCategory();
        sub1.setAlias("my-thuat");
        sub1.setTitle("Mỹ thuật");
        subModel.save(sub1);
        listSub.add(sub1.getAlias());
        
        cate.setSubCategory(listSub); 
        cateModel.save(cate);
    }
}
